package com.jason.campusinn.utils;

import android.content.Context;
import android.content.res.AssetManager;

import java.io.IOException;
import java.io.InputStream;

/**
 * Created by yuandian on 2015/5/12.
 */
public class ReadJsonFile {
    public static String dataAnalyse(Context context, String jsonFile) {
        String jsonData = "";
        AssetManager s = context.getAssets();
        try {
            InputStream is = s.open(jsonFile);
            byte[] buffer = new byte[is.available()];
            is.read(buffer);
            jsonData = new String(buffer, "utf-8");
            is.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return jsonData;
    }
}
